package inherit;

class Base{
    public int a=1;
    public int b=2;

}
class Derived extends Base{
    public int a=3;
    public  int d=4;

    public void test(){
        System.out.println(this.a);
        System.out.println("访问父类的变量"+super.a);
        System.out.println(this.b);
        System.out.println(this.d);
    }

}
public class Test2 {

    public static void main(String[] args) {

        Derived derived=new Derived();
        derived.test();
    }
}
